package com.cike.sparkstudy.sql.java;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;

/**
 * 自动分区推断
 */
public class ParquetPartitionDiscovery {
    public static void main(String[] args){
        SparkConf conf = new SparkConf()
                .setMaster("local")
                .setAppName("ParquetPartitionDiscovery");
        JavaSparkContext sc = new JavaSparkContext(conf);
        SQLContext sqlContext = new SQLContext(sc);

        DataFrame userDF = sqlContext.read()
                .parquet("/developerCodes/test/user/gender=male/country=US/users.parquet");

        userDF.printSchema();
        userDF.show();


    }
}
